/**
 * 
 */
package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;

/**
 * @author Jason Biao
 *
 *网约车驾驶员统计信息接口
 */
@Entity
public class BaseInfoDriverStat extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7512286646757330243L;

	private int address;

	private String licenseId;

	private int cycle;

	private String orderCount;

	private String trafficViolationCount;

	private String complainedCount;

	public int getAddress() {
		return address;
	}

	public void setAddress(int address) {
		this.address = address;
	}

	public String getLicenseId() {
		return licenseId;
	}

	public void setLicenseId(String licenseId) {
		this.licenseId = licenseId;
	}

	public int getCycle() {
		return cycle;
	}

	public void setCycle(int cycle) {
		this.cycle = cycle;
	}

	public String getOrderCount() {
		return orderCount;
	}

	public void setOrderCount(String orderCount) {
		this.orderCount = orderCount;
	}

	public String getTrafficViolationCount() {
		return trafficViolationCount;
	}

	public void setTrafficViolationCount(String trafficViolationCount) {
		this.trafficViolationCount = trafficViolationCount;
	}

	public String getComplainedCount() {
		return complainedCount;
	}

	public void setComplainedCount(String complainedCount) {
		this.complainedCount = complainedCount;
	}

	 public static OTIpcDef.BaseInfoDriverStat convert(BaseInfoDriverStat data){
	        OTIpcDef.BaseInfoDriverStat item = OTIpcDef.BaseInfoDriverStat.newBuilder()
	                .setCompanyId(data.getCompanyId())
	                .setAddress(data.getAddress())
	                .setLicenseId(data.getLicenseId())
	                .setCycle(Long.valueOf(data.getCycle()))
	                .setOrderCount(Integer.parseInt(data.getOrderCount()))
	                .setTrafficViolationCount(Integer.parseInt(data.getTrafficViolationCount()))
	                .setComplainedCount(Integer.parseInt(data.getComplainedCount()))
	                .setFlag(data.getFlag())
	                .setUpdateTime(Long.valueOf(data.getUpdateTime()))
	                .build();

	        return item;
	    }
	 
	 public  static BaseInfoDriverStat  convertPojo(OTIpcDef.BaseInfoDriverStat data){
		   BaseInfoDriverStat bids=new BaseInfoDriverStat();
		   bids.setAddress(data.getAddress());
		   bids.setCompanyId(data.getCompanyId());
		   bids.setComplainedCount(data.getComplainedCount()+"");
		   bids.setCycle((int)data.getCycle());
		   bids.setFlag(data.getFlag());
		   bids.setLicenseId(data.getLicenseId());
		   bids.setOrderCount(data.getOrderCount()+"");
		   bids.setTrafficViolationCount(data.getTrafficViolationCount()+"");
		   bids.setUpdateTime(data.getUpdateTime());
		   return bids;
	 }
	 
}
